import { h, render } from "."
import { isString } from "../utils/utility"

export function createApp(rootComponent) {
    const app = {
        mount(rootContainer) {
            if (isString(rootComponent)) {
                rootContainer = document.querySelector(rootContainer)
            }
            render(h(rootComponent), rootContainer)
        },
    }
    return app
}